package controllers;

import play.mvc.Before;

/**
 * Created by IntelliJ IDEA.
 * User: Cyril
 * Date: 06.08.11
 * Time: 23:34
 * To change this template use File | Settings | File Templates.
 */
public class UserChecker extends MenuBuilder {
    @Before
    static void checkUser() throws Throwable {
        MenuBuilder.buildMenu();
        boolean isAdmin = CustomSecure.check(new String[]{"admin"});
        renderArgs.put("isAdmin", isAdmin);
        if (isAdmin)
            flash.put("isAdmin", "1");
    }
}
